/*********************
* Author:Dzlua
* QQ:505544956
* time:2016/09/04
*/
#ifndef __EDUI_TABLELAYOUT_H__
#define __EDUI_TABLELAYOUT_H__

#include "Container.h"

EDUI_NAMESPACE_BEGIN

class EDUI_API TableLayout : public Container
{
public:
    struct {
        Event2<TableLayout*, size_t> selectedChanged;
    } evt;
protected:
    TableLayout();
    virtual ~TableLayout();
public:
	static TableLayout* GetInterface();
	virtual void Release();
    static TableLayout* ToTableLayout(Control* ctrl);
public:
    size_t GetSelected();
    bool   SetSelected(size_t iSelected);
public:
    virtual void AutoLayout();
    virtual void SetAttribute(const char* name, const char* value);

    virtual Control* FindControlByPt(int x, int y, Uint32 flag = FIND_ALL);
    virtual bool ChildCanInvaldate(Control* child);
protected:
    virtual bool HandleMsg(Msg* msg);
    virtual void Render(IRender* render, const Rect* rc);
protected:
    size_t m_iSelected;
};

EDUI_NAMESPACE_END

#endif
